package com.zyh.homework.test1;

import com.zyh.homework.test1.domain.Book;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

/**
 * @Author zyh
 * @Date 2024/8/1 20:28
 * @Description
 */

public class Test1 {
    public static void main(String[] args) {
        Map<String,Book> map=new HashMap<>();
        map.put("001",new Book("三国演义",19.9,"清华出版社"));
        map.put("002",new Book("西游记",29.9,"北京出版社"));
        map.put("003",new Book("红楼梦",39.9,"武汉出版社"));
        map.put("004",new Book("水浒传",49.9,"北大出版社"));
        Set<String> keySet = map.keySet();
        for (String key : keySet) {
            Book value = map.get(key);
            System.out.println("图书编号为："+key+"\t图书名称"+value.getName()+"\t图书单价"+value.getPrice()+"\t图书出版社"+value.getCompany());
        }
    }
}
